<!DOCTYPE html>


<html lang="en">


<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    mysql双主同步 |  Linson
  </title>
  <meta name="generator" content="hexo-theme-ayer">
  
  <link rel="shortcut icon" href="/blog/favicon.ico" />
  
  
<link rel="stylesheet" href="/blog/dist/main.css">

  
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css">

  
<link rel="stylesheet" href="/blog/css/custom.css">

  
  
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

  
  

  

<link rel="alternate" href="/blog/atom.xml" title="Linson" type="application/atom+xml">
</head>

</html>

<body>
  
  <div id="app">
    <main class="content on">
      <section class="outer">
  <article id="post-mysql双主同步" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  mysql双主同步
</h1>
 

    </header>
    

    
    <div class="article-meta">
      <a href="/blog/2020/05/25/mysql%E5%8F%8C%E4%B8%BB%E5%90%8C%E6%AD%A5/" class="article-date">
  <time datetime="2020-05-25T09:22:20.000Z" itemprop="datePublished">2020-05-25</time>
</a>
      
  <div class="article-category">
    <a class="article-category-link" href="/blog/categories/%E6%8A%80%E6%9C%AF/">技术</a>
  </div>

      
    </div>
    

    
    




    

    
    <div class="article-entry" itemprop="articleBody">
      
      

      
      <div id="hexo-blog-encrypt" data-wpm="抱歉, 这个密码看着不太对, 请再试试." data-whm="抱歉, 这个文章不能被校验, 不过您还是能看看解密后的内容."><div class="hbe-input-container"><input type="password" id="hbePass" placeholder="您好, 这里需要密码." /><label>您好, 这里需要密码.</label><div class="bottom-line"></div></div><script id="hbeData" type="hbeData" data-hmacdigest="c70faa9503883f8db17a009cd3ff6ddad9583d408f71f5f2f470b7952f3bd711">4185a57356617023221f490e19283d4dfb6127dc8e7c4b2bfe2aa007fa6c76a356aed0d381379e7553ff2d9bfba46eb305bd7b8225dc6fe0dfe2b631f2d1eeade1d350e87e670ef751c7bd42e2ed8431bf4c33860383f831cb6c9627ff67f4a89f5e7eb241e796bcf44f6c334403804d388a03abdd5fcfe19e52612d5e5e0dec14be1483bcf48378f2695848af68273f1626d5c30dd131ca804884f999d287ed0769fb3fd2da740a3bb3f522bdccc621c5d08c4bb8388da41436be7b1721b58243adf9b02087e1a1cda6dbd7a9371a1c55bbc7856640e81e49c774889df2391428b219e5cbc7e4aac9e8810ab23132d5626f6eab9631de7ac7f25dfd0bcedd1240c3c353f4b88ca6d63345cddd138c8bb2e1a89e6f2d3079acc5af73d1a7a99cc9e10f3f53850c60e0e56829cb1946902aa9235425352c906e6cf991806642d3907929fa4c0788b69b833d38f6939e4a2721590994544ff0012f23ec7cb8199feaa86d3e4b147b78fe131a7b45f27a96f309a0c08503fa18d40c2fc7d1f8dd0d6caae9efb9e05fef480cac554997a7d1d61eed9e06916a8d5eec3b4d708ec6b0b34656e6d905fbf462a9358e66361a12fe50ea348c549336706fdce71ec6defecc51e3a58d80d22a9f9c85de25ecee90a7d2bf04f3893f9ab75215e4419e9d31ce6dbe9b617ab1fd6e5189bbe969a4d3a241a372978e371499b4811e2b31729f8b36b6862f09dae0a691cd3e34033267892530911b37ace3c20b718e4ebf07e4761e50c234a62fe405796009b6c24b9fe767719715ac12508ab5f7d7c40c3eb01b6dc8c75ce195a1e255e3a9824b37d6e0fff225a2009a7c544df31f61f67b601c1698a232a1b1e89a92013aafe85aeeb2ab10b329e24692c843d1092cee3bf42a5a0e0cc6f01bbe6c7bbf334d4f21b8572fe7d70ee18efe15d38ae33d6a39fd030c57cf954dd1fd5447305c0326d8d3979c2b1ba4ddfdaa9bfbb2e6cbb778d3c4673d37bc8baee6295825d30fe7eb623a9bb513d89730d0558fff99c4f9c75942b42592e13386cde35660382c643ab9ec12659211fdfa236f3e0a95605b020d1231a895ab7e48093ff6863842e44a7ad7a61c3cb60faaf08aa69404abd116d15e48a13c9b7240e88c099bcc5345d8918fbda5b30848273621b9ec04cfb264b4690bc94429a8e94c183fef5e3f4771f49d7861e4fea14ffd81a15ae9a634932141b168c142861ec82544c649890e303cab931738e962247dc51c179f8d578d1f3498a9b18c2f4afd18f73c8ac87821f38448ed55c9f61c1b42b07002531c0ae8c8a4e6b53f413f60f6b6143f57127ee251a42fbe047078acabc9abe387da5b3252817efa9f45576da918b8f2c8c5f0df1b9be7f708365ecc1da447a81caccca512f9201de88aaf213b1d100b933e7dd14ca5f28aeae7c8516f7bd3e941aefb9fe4a8bda13df6319baf75038d145d95357979ffb3681c8ffa2eb2ba2cfe84f52a674bad73c8f77f5c18896b78e3d44505455a5e4f40131864e80020a03cd8179042de81557a14462d447814cb6228361b9c174c7f266872f69c5eea2e65623aef2d7387a0b25ecc9b1c7583bbc576db39345a238f986350ee6de0cc90e44ed9076ca779b460cc3d974c2fc690d267222e8a1f7b45d9fb1f04da54f63a06f34219f103f4ce2bca3cb44410265f28034cb4d14b0d5233e0e8a6defe448e08786de4597e91ebf1497abbb22a2c1c5a93bf0b751beba7e039b967c10eaf69c247a741dae2445c111e3f31040b25a4bcad501c9da87b67c625a27b333087dec8492e1fe190730323a69eca7e849f73edbac10ce799b7a07d3bd2b23902f0e06e2135c3ba3021f016b9326017f7eaa901997bcddd39fd2afa60e02512c690c5fccdc2691998ba9ae62c3442007fda186443f44e664663ac33e842d21b6afcc14ed83018119be1ef208391dc6cff660d8610b8041b0a3aa93b155e8304c1a9b291cc9435263aa06e4bd476fc9f5deee0b40142479582e02ae4095de7596de02d7a83c71276fde8e6779925a461d3adb0d67607092f076422e39b4b8939b141dfbbe236817a014a75eb8b02cadeba3e3877962b40c2da1eabfd7479ca51570edd0f9066ad1324fb24c8afe7794058485d527e3ee5180d7577a54dc1d3ee149a342bd326810672d63d8d10de8f959aeb868600f11bab4f3257552ce985695ba1cf1d076f78dcb00c0e2c1852489a1cc9dc3ddc1f6765c8b2a132a32be1920a12bb87650faad04988429632b20b9424e632589f0c8f06bac352a5cfc53b5537f7ef333991babdac7e260d799010df028d1ff4cae6fea29a7787d28a6fb79a29f5fa3511c4f825f24e09324bd05a8a3701ee6768489dc3fb3ff847f8d6e9215636c4f8f801da439a3cd548debcdf5341280b87fa318dc5d0d42360ca06455070904012ecb05ed62acdfb44634337e7d3a7f4721a06382a22ae9ff80443d492b4b5f57ea5c418e7787340ea4787b19fbe3fea782a25034c9ce8053e2232194f10e91abac4a03e52d177935a1fae32faebf4c68340e4018977d09d07510caf09a7a40a7074ef8369a5846cb00b6c9655097b4025ab8417d24521f91a44b4dd241b44af66754c484988b7ec858d0e7d9283dc7da1c791c71fb627280a0cb53026e3eb13d10b754069f9d9b121e91cafad08574a15321065768163ecb43a0f132ed7c3e285b140234a2c87a99195aab62976bdf9f9525f5502fe9bf659133e1d3636ea475f1b20eba6bd4425ec2a61e193b0fc01dcac9477c18027fcb40978782c470d89affbc7f9ee9178559927f71033da24ebf5633c4ec96dc53826ec351278c18dd34263b980f1f9828502fc07239cdd3233ec73e0ea811cfc7abba78b1be0e6e1b2030438023ba89337615780c8bcba783bf4f61630f67b88f4dfe489ebf3cee30295afa6f20f1a97be43558696afa6283c025637bf8408ea37d3609cc93d9e9d47baf32a5102d1dd6f7454959de7da846ca1a937786e3b7a4ccb7df6fbaf563afa0e5b5480a37a2d710f998b12dab349518987f087170433fe8cc49afcedd67dcf75c9397704e865282f5c3a0e04bf5cc5058a34a40f4c2e2fb1c67684b969c3b74f4eae621706a09a488401bf65eda7c4fefb56b65c09f9a5ca822d767a9fe9792b2785f07cec6bd08a69b605d7a1beecab3135caf4cf703796cf28ceb916e853d4b0a04a8e9f9fa6a1525c119d31b528b6080a620a74b157ca6850f2c062e00d80a3d78b72c55fe356e853db007814bf4ba320d838722f2b18d626bd280a46f2f70b45a96b54478f3b7172d7156e3028dfb7e03f17771a8c1287945ddb0596ea8f5993674f0bdf5341e641eae51f754edf9fdcbf2b45d0ea54d0fe76cb50b184a129a6a1bd055a36102a4a931e4a0b78e6cd97fb59a0eeb89ef6bc8b3641509432f4256a0f6c28a145cc04bf0c94e1406cb616d8ac1cdfd3e4d4417f03bd18d8770fa9014c837ce98d9755ca9c4edd2afa79a2847e9f23307a4b69185a8c762c1246388fdac3e797585f1978b51de0829dcc62dcdfd8aab45228f101c72cac4823ed41b06c24d91ece2c62dd82787d328a8b3584fa3f1ef71cbbfda180fd29db79f18b115017478fc22e9fb2e6a5a4b718d0e10837d2361bb052fecad7c39415366bef82925f72714f815c4659131e6be7e20ccbb1fb50c2a037531626a426058a8f8ddb2ad0fcf1efe60da63069607c690bc24c5ee2298a3b4b59c9e295f84e1777224932d26b2c9bb75c0588493e96a50a920ff11c021086f9701fd28d1f4d156f086378481ce2c4519d23d0568ee1b853439f0ce3547e1d5d757379948a77633ede32aaf9a71f629cf917b9620e66ce6a4681b6770ac6e11a6933a3089c166ae234d2c56d0218d43b18f8ebe17ef368cf4d4ef96fe71e08c4f7d8e0392b1888552e729fa43564e1c5e588d98e3434fb8bb4517d034f284ef9fbf86b6e919ade45bf72c3df657e8b9a0ffc9ceb98ea316d638e5636acd93f02ee9abbd873139ff000e6793e806212b64fc2ee9bca335a52ad7cf335425908feee4733b32bac10a71dfe7c5e2860fbd9d3091f3e4c08d48c759e566ed2db0785ab985480a901742ca990a3dfc4ec7b075db9a35ce393636d255fe939327d833296bd34bbd1a4f3c678e10fc531d4dfdf946def56aa62f19edfa53e30f8a2fc86ff78480e2b61212ae23c9e6dbb07cbf5ae7f608a3c4d5b0d51fb25a61e0cb0f234fb756521cd28831e762c5e49070d15b66dd37534df0a00add678d843cb7acf7bfde12d30ade0255699859ab49dbb641f69b3107755e6d9b748b551881a7fcf0e08206828c4e87256354ad4c5ea38f7230e6a2ede72e235508caba6886657599114730aa3b1daa0283a50bd25e4c6589c06a3d0bd56c6d8ab914fb8af0720ee8f96ccc408aba0ba5ba97b7552accce9401e5034c42bac952ded504e75974370854f297807122d6d15a65c9bd5498c192ca8a050b3e87083c03b88244537f286c10e5cc147d58865ada0de76d437531d221db37521290bd89aac4c906202bdcc7dbf330b23a6c7cb09051ebb69dc23abb753c543fa831a0f4fdcdef70eca7c47bcc27691f315ba6ffb9545d129630fb5d7986c112759bf4b18e13691f20e94416bd179330a80bb0e81989af502ba2b4abe471690d1cf80fb432c041c3af8b7cd99db2eb1890a64c24102ee44d6300bc60fcf301b926dce522c933a9e9d80eb31beff462222b6a0b2c25831dc728fb4d8874c4a2ae30629b80ab3a335170f9becfa42e82174cddb2a4e0eb68f448fa8286db458e74125498fbd86d63c5758cc5e37b0e25af2ff1ac3260853f4972f3f1b6f0b872a2ad1bb73f1aea8122e5e68690ee04c9e9330c96c9d16e5563c604f1afd1876c0374f2303a1b5a07d716d1a9a446ae5fb5cea8327ad91ecae240d80cf432c77b3eb488520c7cdae5f77b666e91bec0f340df7dae0729cb6663c34ff15500b7dbdca4237c34e81c8d93d199e0a46bc608e87c0b3ed81c9980b0cdf8223db4bcb13912ab6a9c6ac52e1e2b15fbc6a276f0623e144e0d8769994c69a57d84619800e4af91a93864262b40d85e1e8012a87f88f650a3ea90ad45a5baeea58f4f3932f8679e18254646a8183a3fc7869930085cb8837e438e0f8697ebf8aef3e99384f39eee440b117e1946cadc01211697de869d71d14879e3b77756677ac90a57725645dc53ae8f8c01ea9c690baae91b6b477aaafa9b6903ba1feaaec5fe9282793944226a9cdd701ca10749570bea7c8fac81576aa69b832ac3f00cc4f2de566f4df7607a352c1eb5a4d454d09a67aac2bdaa9aacd8afd11b01b076f0ba49122305773933ce615347bf4ce2087f49ffc2c4f90d6b633dd7201fbd0e7485bfc1ccdbe158b4623e351bbbf4fe548c5bc8e8f07e5116612734731bfa2d21667ae729aa317e4678dfef9eb3993dfab309340a589107ff349aa2d0b1a2dfddb5e0200ffe2c75d8f5fde6649bcdb34d7d993d6040959891073de9cdb8268bc2295f88798063d4048bc4d0cf2e8024a5db392adeb2d696869b8a134c64f15651eb0cc544c15f2fce9bef6aa6220a7ea88d1356706885c6778128d10bc706da8a50d9e78babdaa0b9d0a8657153abf376fb059e568ded7a550876d2e0f35fbf392d5b818504856d33e9d92bdde1f794b82dae65983c04f117058598161512e890c41bc4a48ad6714f6c35991f3842525ddf7a9057e5957eb7612eacbe32587719f49d965ba6e183de6b281f91220bbe3b3a632222b607aa3f4c0ac742adb341e5d6c452bf2dc047fcad4083b975d12b36415d8c6bae28129be6e679218e928bee6a0a64eb9ed256a166b4bc67a97eb88b776f743433bfa4b52765d0de51e1ee785f75da419d35aa28795a1d51d87987cf2ac9cbfe2298ee46da55855c0e50775fda3f28f289808e14159748ab85d3b8e9958abde67e0841dd9de428bbdcac1a840b99c78552d275bce0eceb66d5aba617e72ba5018470cfc48c1727782bc2c1623ce8caebd083cf103921d0aac0c266d9d683ba9090715a2cb522d43ae3983ad43c46f49fc6597a64c905573f3b1f9351494bdc447b6cc210f05ba59adb44f44ceab1715628632923f0022fa8ee6aa7cc43ec5b5c80e8be9f3cfd77be9e85567dc719aaa43c5d13651195cb16a6f68fe57adf46d9c7dc0cbf97c5f6d6e79968b8b3e50c9eed6b5a8423d17c6eedf2d42dd07dd9b8c3157d9350d51b35b3337ab486f2c6bac044db9f916d5f6fe105b3ca14dcdb02d5844034f1e1ca886e032886e0bff5e4ada2735cd9b9574322b95bb25c17cb08b9ae32d001eb3b31c3be7783cef81b55045b3c6d1abcfe2064569059c1436d90858031534e35a3ae29d2d09a5d8713f993d30b31a348d6f738716a1d57cf2ca6a79cc1a9ed8f9ed7606da91ba53cc61330bb039790430394e141906842e110ebdb0056b11fffb5a76f5540522c2d536a25383724b016f3de7dda8512b881fa943e085ed1561799a54021fd0952b92a8feafc75b2e684ba16be4f753ac56e5780077b2ed1c1ef1b09392ab07ba3275cdf1ec4d8478ec50fbc19596f675d89d61c835e71ef5d48d7628c600795b057a838831ba839de1000228a873cc0680d606e5e2362e62a0e76f1b3ce6bb64af959f3b6d546e59c335b846391bf4675746e383b2aca4fbda3d8f0b17e9db555d6f63bb19723b8a140343b66193b11e30485e617e4376d52f4ea42d615f905367fa9cf6e1c4c3a8e8b14334579ab84bd4c993498abe2cafa1f10eb12eda901a8e95ffaf617bddcd56bb5ff0e15ead8ef9f9c78e86b9eb0aa8256e57dde6065ecda910ed12b70d1906307128316ce4a6296955a0d5b9f22343d035ea3b43f2b64825cc9a4170c3700f583f6fbb30043495fa024ee63abbc0de1329f9c3a148dd1db71411bde6a96ff7f9e3d967f4fafcd3a4084de56e586ef537627be5f80480c9ade5e6d9863eed722dfeecf1c99628f9f56e81a6df7e1920b6f0e12dac8ebf9aaa2df7df4d84795730af0f9a7e8f5c12b1068b220a0621989665f737738f50f16b6fcce02530fe42bd53ffbbf54db405a69e9e9ef5320c05f4cf09c544752200164a344523800ad3a1dd4acbe4283934aaeb5fbbb4d331d245e97a78ca7321529fc397d0d1f98d23aae04dd831aa1868662e2811fb015395a8518d637eaa41d1abd5c44b76c2c293eddb7134075f4a0ecde3c7b08991a92daeac66582d40739c1cf04239472f8f839d8201b75a5c6026338658ce247aede18acfd5375310f7e1117cb63088a6ec05b435d3c28f26ae52ed65a0a396218208caa59b174e08ac4bfb960ed0dc77846f12fa310d039995ec04c859897019e2ba93a86ca6d86d32615abc7d3e342edae555aeecc4b230158517e874c29851146d0e2fa3b1585d89ac5d0b0313caacd48a1a5a2375d527a34e1f20d43d0cfbddc8a9683be46f65633df1b4d81aa4064339d4aaa56d95ae642aa1d5f4fb37612d002a613fb0e85779144de21465bcf7f0f839002821c4fe339a7b99257a4c5fba34470ba937d1a7ed30a8d35e5958b0b359d6fe9eff727c9362517a5e12aee8db6c1f9be3bf10a50e1578caec0cf883101b3ee14d6d092b8a2d210e8590729cbefa7e8581b833e5c234a216d78bf2972233a18ada29d5f315ac29b8d214ce02d227b94d972196bafb19d4c68b4776f98cadb41f008d8dd271d8ac3fb32b245d73ea8c6cfdc8d0056f7da8b659a6076075f02de411f9b8953a93329b86ede05037f129a54f74fa32be74a72a5ba262fe37b33b19141bfbfa561f55c60824bf693eb1f40f82add8282077e7d7a8c3eebbe0aaaf218eea1d01bcccaf2cdc8757f1113483070f6ba1752dd8c9916cc3902362412e09be07d96eedd5caa6e2b5f7628a7857</script></div><script src="/blog/lib/blog-encrypt.js"></script><link href="/blog/css/blog-encrypt.css" rel="stylesheet" type="text/css">
      
      <!-- reward -->
      
    </div>
    
    
      <!-- copyright -->
      
    <footer class="article-footer">
      
          
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://linson0116.gitee.io/blog/2020/05/25/mysql%E5%8F%8C%E4%B8%BB%E5%90%8C%E6%AD%A5/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/blog/tags/mysql/" rel="tag">mysql</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/blog/tags/s/" rel="tag">s</a></li></ul>


    </footer>

  </div>

  
  
  <nav class="article-nav">
    
      <a href="/blog/2020/05/25/page4/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            page4
          
        </div>
      </a>
    
    
      <a href="/blog/2020/05/25/hello-world/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">Hello World</div>
      </a>
    
  </nav>


  

  
  
<!-- valine评论 -->
<div id="vcomments-box">
    <div id="vcomments">
    </div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js'></script>
<script>
    new Valine({
        el: '#vcomments',
        app_id: '',
        app_key: '',
        path: window.location.pathname,
        notify: 'false',
        verify: 'false',
        avatar: 'monsterid',
        placeholder: '给我的文章加点评论吧~',
        recordIP: true
    });
    const infoEle = document.querySelector('#vcomments .info');
    if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
        infoEle.childNodes.forEach(function (item) {
            item.parentNode.removeChild(item);
        });
    }
</script>
<style>
    #vcomments-box {
        padding: 5px 30px;
    }

    @media screen and (max-width: 800px) {
        #vcomments-box {
            padding: 5px 0px;
        }
    }

    #vcomments-box #vcomments {
        background-color: #fff;
    }

    .v .vlist .vcard .vh {
        padding-right: 20px;
    }

    .v .vlist .vcard {
        padding-left: 10px;
    }
</style>

  

  
  
  
  
  

</article>
</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2019-2020
        <i class="ri-heart-fill heart_icon"></i> linson
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></s>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/blog/"><img src="/blog/images/ayer-side.svg" alt="Linson"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/photos">图片</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/blog/about">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/blog/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <script>
      if (window.matchMedia("(max-width: 768px)").matches) {
        document.querySelector('.content').classList.remove('on');
        document.querySelector('.sidebar').classList.remove('on');
      }
    </script>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/blog/js/jquery-2.0.3.min.js"></script>


<script src="/blog/js/lazyload.min.js"></script>

<!-- Subtitle -->

<script>
  try {
    var typed = new Typed("#subtitle", {
      strings: ['面朝大海，春暖花开', '', '想要的都拥有，得不到的都释怀'],
      startDelay: 0,
      typeSpeed: 200,
      loop: true,
      backSpeed: 100,
      showCursor: true
    });
  } catch (err) {
    console.log(err)
  }
</script>

<!-- Tocbot -->


<script src="/blog/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: 'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto'
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/blog/dist/main.js"></script>

<!-- ImageViewer -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>

<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->


<script src="/blog/js/busuanzi-2.3.pure.min.js"></script>


<!-- ClickLove -->

<!-- ClickBoom -->

<!-- CodeCopy -->


<link rel="stylesheet" href="/blog/css/clipboard.css">

<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>



    
  </div>
</body>

</html>